import { defineStore } from 'pinia'
import { getvoteinfo } from '@/api/importantNews'

interface Ivote {
  humen: any,
  hvoted: any,
  isleader: number,
  teams: any,
  tvoted: any
}

export const useHomeStore = defineStore('homestore', {
  state: () => {
    return {
      voteinfo: {} as Ivote
    }
  },
  getters: {

  },
  actions: {
    async GetVoteInfo() {
      const { data, status } = await getvoteinfo()
      this.voteinfo = status === 0 ? data : {}
      return data
    }
  }
})